﻿using System;
using System.Collections.Generic;
using System.Data.OleDb;
public class DataProvider
{
    public static OleDbConnection OpenCn()
    {
        string Cntr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb;Jet OLEDB:Database Password=KS4Emv3nRpGfjLwWPQ16;";
        OleDbConnection Cn = new OleDbConnection(Cntr);
        Cn.Open();
        return Cn;
    }
    public static string Today(DateTime date)
    {
        int songay,i;
        int[] a = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
        string[] Day = { "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" };
        songay = ((date.Year - 1) % 7) * 365 + (date.Year - 1) / 4;
        if (date.Year % 4 == 0)
        {
            a[1] = 29;
        }
        for (i = 0; i < (date.Month - 1); i++)
        {
            songay += a[i];
        }
        songay += date.Day;
        i=  songay % 7;
        return Day[i];
    }
}